package com.hong.concurrent.chapter18;

/**
 * @Author csh
 * @Description
 * @Date 2018/7/12 22:01
 */
public final class ActiveObjectFactory {

    public ActiveObjectFactory() {

    }

    public static ActiveObject  createActiveObject(){
        Servant servant = new Servant();
        ActivationQueue queue = new ActivationQueue();
        SchedulerThread schedulerThread =new SchedulerThread(queue);
        ActiveObjectProxy proxy = new ActiveObjectProxy(schedulerThread,servant);
        schedulerThread.start();
        return proxy;
    }
}
